﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Caching;
using Volo.Abp.Modularity;

namespace LiveShopvnext.Application.Caching
{
    public class LiveShopvnextApplicationCachingModule
    {
        [DependsOn(
        typeof(AbpCachingModule)
    )]
        public class MeowvBlogApplicationCachingModule : AbpModule
        {
            public override void ConfigureServices(ServiceConfigurationContext context)
            {
                //从appsetting.json里取数据库连接
                var configuration = context.Services.GetConfiguration();
                var RedisConnectionString = configuration["Caching:RedisConnectionString"];
                //注册redis服务
                context.Services.AddStackExchangeRedisCache(options => {
                    options.Configuration = RedisConnectionString;
                });
            }
        }
    }
}
